package logic

import (
	"context"
	"gitee.com/shijun123456/rpcVotes/internal/svc"
	"gitee.com/shijun123456/srpcinterface/client/votes"
	"github.com/tal-tech/go-zero/core/logx"
)

type XindaluLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewXindaluLogic(ctx context.Context, svcCtx *svc.ServiceContext) *XindaluLogic {
	return &XindaluLogic{ctx: ctx, svcCtx: svcCtx}
}
func (x *XindaluLogic) GetInfo(info *votes.ArgsGetPayInfo) (*votes.ReplyGetPayinfo, error) {
	//这里可以 ctx svccontext
	// server-svccontentx
	// service->svcctx
	//
	//这里进行处理真正的业务 l.svc.model l.svc.commo.lib l.svc.redis l.svc.ctx
	// l.svc 是西汉希望
	// ctx 是传递的注入的
	// new conn
	// newctx
	//
	order_info, err := x.svcCtx.XindaluModel.GetInfo("1111")

	if err != nil {
		return nil, err
	}
	return &votes.ReplyGetPayinfo{
		Data: &votes.Pay{
			OrderNo: order_info,
		},
	}, nil
}
